/*Author : Rozi Kapara Dista*/

package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.field.SpinnerField;

public class TaskTerminationField extends GroupControl{
	private CheckButton terminDateField;
	private CalendarControl terminDate2Field;
	private CheckButton terminMetersField;
	private SpinnerField terminMeters2Field;
	private int i;
	
	public TaskTerminationField(String bindID){
		setTitle("header.TaskTermination");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		terminDateField = new CheckButton("Terminate task tracking on (date):");
		terminDate2Field = new CalendarControl("tgl",20);
		terminDate2Field.showYearSpinner(true);
		terminDate2Field.setPreferredSize(new Dimension(166, 20));
		terminMetersField = new CheckButton("Terminate task tracking on (meters):");
		terminMeters2Field = new SpinnerField<String>("domains","domain");
		for(i=-100;i<=100;i++)
		{
			terminMeters2Field.insert(i, true);
		}	
		terminMeters2Field.setPreferredSize(new Dimension(166, 20));
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addField(terminDateField)
		.addField(terminDate2Field)
		.addRow()
		.addField(terminMetersField)
		.addField(terminMeters2Field);
	}
	
}
